package com.vic.mvc.testsome;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

/**
 * 测试泛型
 * @author VIC
 *
 */
public class FanxingTest {

	public static void main(String[] args) throws Exception{
		test();
	}
	
	
	public static void test() throws Exception {
		List<Integer> list = new ArrayList<Integer>();
		list.add(123);
		Class<? extends List> instance = list.getClass();
		Method method = instance.getMethod("add", Object.class);
		method.invoke(list, "我是字符串");
		System.out.println(list.get(0));
		System.out.println(list.get(1));
	}
}
